﻿using System;
using System . Collections . Generic;
using System . IO;
using System . Linq;
using System . Runtime . InteropServices . WindowsRuntime;
using Windows . Foundation;
using Windows . Foundation . Collections;
using Windows . UI . Xaml;
using Windows . UI . Xaml . Controls;
using Windows . UI . Xaml . Controls . Primitives;
using Windows . UI . Xaml . Data;
using Windows . UI . Xaml . Input;
using Windows . UI . Xaml . Media;
using Windows . UI . Xaml . Navigation;

// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236

namespace WenceyWang . RichMan4L . Maps . MapDrawers . UWPXaml2DMapDrawer
{
    public sealed partial class MapDrawer : UserControl
    {
        public MapDrawer ( )
        {
            this . InitializeComponent ( );
            this . Loaded += MapDrawer_Loaded;
        }

        private void MapDrawer_Loaded ( object sender , RoutedEventArgs e )
        {
            MainGrid . Width = Map . Size . X * 112;
            MainGrid . Height = Map . Size . Y * 56;

            Width = Map . Size . X * 112 * 1.5;
            Height = Map . Size . Y * 56;


            for ( int i = 0 ; i < Map . Size . X ; i++ )
            {
                MainGrid . ColumnDefinitions . Add ( new ColumnDefinition { Width = new GridLength ( 112 ) } );
            }
            for ( int i = 0 ; i < Map . Size . Y ; i++ )
            {
                MainGrid . RowDefinitions . Add ( new RowDefinition { Height = new GridLength ( 56 ) } );
            }

            foreach ( var item in Map.Objects )
            {
                
            }
        }




        public Map Map { get; set; }



    }
}
